<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改定时任务')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-cron-edit" th:object="${springScheduledCron}">
            <input name="cronId" th:field="*{cronId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">任务描述：</label>
                <div class="col-sm-8">
                    <input name="taskExplain" th:field="*{taskExplain}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">状态,1:正常;0:停用：</label>
                <div class="col-sm-8">
                    <textarea name="status" class="form-control" required>[[*{status}]]</textarea>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">定时任务开始：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="cronStrat" th:field="*{cronStrat}" class="form-control" placeholder="HH:MI" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">定时任务结束：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="cronEnd" th:field="*{cronEnd}" class="form-control" placeholder="HH:MI" type="text" required>
                    </div>
                </div>
            </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label">定时任务周期：</label>
                    <div class="col-sm-8">
                        <textarea name="cronCy" class="form-control" required>[[*{cronCy}]]</textarea>
                    </div>
                </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "system/cron";
        $("#form-cron-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-cron-edit').serialize());
            }
        }

        $("input[name='cronStrat']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='cronEnd']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        function showRecipientInfo() {
            if ($("#invoiceTypeFill").val() == 0) {
                $("#recipient1").show();
                $("#recipient2").hide();
            }else if ($("#invoiceTypeFill").val() == 1) {
                $("#recipient1").hide();
                $("#recipient2").show();
            }
        }

    </script>
</body>
</html>